package middleware

import (
	"github.com/gogf/gf/net/ghttp"
	"net/http"
)

//Error 全局错误处理
func Error(r *ghttp.Request) {
	r.Middleware.Next()
	if r.Response.Status >= http.StatusInternalServerError {
		r.Response.ClearBuffer()
		r.Response.Writeln("哎哟我去，服务器居然开小差了，请稍后再试吧！")
	}
}
